package com.lczyfy.idcp.common.utils;

public enum ResponseCode {
    SUCCESS(0, "SUCCESS"), //请求成功
    ERROR(-1, "ERROR"),
    CREATE_SUCCESS(2,"CREATE"),//添加数据成功
    DELETE_SUCCESS(3,"DELETE_SUCCESS"),//删除成功
    CREATE_TABLE_ERROR(-1005, " CREATE_TABLE_ERROR"),//创建表失败
    CREATE_DATABASE_ERROR(-1006,"CREATE_DATABASE_ERROR"), //创建库失败
    DATABASE_ALREADY_EXSIT(-1007,"DATABASE_ALREADY_EXSIT"),//数据库已存在，创建数据库失败
    NOT_DATABASE_PRIVILEGES(-1044,"The User is not access the Database privileges!"),//当前用户没有访问数据库的权限
    NOT_ACCESS_DATABASE(-1045,"Do not access the Database ,because of Username or Password is invalid"),//不能连接数据库，用户名或密码错误
    CAN_NO_BE_NULL(-1048,"The Filed can not be null."),//字段不能为空
    ATABASE_NO_EXSIT(-1049,"The Database is not exsits."),//数据库不存在
    FILED_NO_EXSIT(-1054,"The Filed is not exsits."),//字段不存在
    TABLE_NO_EXSIT(-1146,"The Table is not exsits."),//数据表不存在
    FILED_WRITE_FAIL(-1062,"The Filed is Duplicate,Write Fail."),//字段值重复，入库失败
    FILED_UPDATE_FAIL(-1169,"The Filed is Duplicate,UpdateFail."),//字段值重复，更新记录失败
    NO_HANDLE_PRIVILEGES(-1227,"You are not this Handle privileges!"),//权限不足，您无权进行此操作
    MYSQL_TOO_OLD(-1235,"Your MySQL version is too old,need update."),//MySQL版本过低，不具有本功能
    SQL_INCORRECT(-1149,"Your SQL Grammars is Incorrect."),//SQL语句语法错误
    AFFAIR_COMMIT_FAIL(-1180,"The Affair Commit Fail."),//提交事务失败
    UN_LOGIN(-1009,"UN_LOGIN");//未登录
    private final int code;
    private final String desc;

    ResponseCode(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public int getCode(){
        return this.code;
    }

    public String getDesc(){
        return this.desc;
    }
}